var loadScript = function(url, callback) {
  var script = document.createElement("script");
  script.type = "text/javascript";
  script.src = url;
  script.onload = script.onreadystatechange = function(_, isAbort) {
    if (isAbort || !script.readyState || "loaded" == script.readyState || "complete" == script.readyState) {
      script.onload = script.onreadystatechange = null;
      if (!isAbort && callback) {
        callback();
      }
    }
  };
  document.getElementsByTagName("head")[0].appendChild(script);
};